package cn.yy.pojo;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Income entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "income", catalog = "phoneerp")
public class Income implements java.io.Serializable {

	// Fields

	private Integer incomeId;
	private String incomeName;
	private Double incomeGrow;
	private Double incomeMinus;
	private Double incomeOrigin;
	private Double incomeFinal;
	private Date date;
	private Integer accountId;
	private Set<Recipt> recipts = new HashSet<Recipt>(0);

	// Constructors

	/** default constructor */
	public Income() {
	}

	/** minimal constructor */
	public Income(String incomeName, Double incomeGrow, Double incomeMinus,
			Double incomeOrigin, Double incomeFinal, Date date,
			Integer accountId) {
		this.incomeName = incomeName;
		this.incomeGrow = incomeGrow;
		this.incomeMinus = incomeMinus;
		this.incomeOrigin = incomeOrigin;
		this.incomeFinal = incomeFinal;
		this.date = date;
		this.accountId = accountId;
	}

	/** full constructor */
	public Income(String incomeName, Double incomeGrow, Double incomeMinus,
			Double incomeOrigin, Double incomeFinal, Date date,
			Integer accountId, Set<Recipt> recipts) {
		this.incomeName = incomeName;
		this.incomeGrow = incomeGrow;
		this.incomeMinus = incomeMinus;
		this.incomeOrigin = incomeOrigin;
		this.incomeFinal = incomeFinal;
		this.date = date;
		this.accountId = accountId;
		this.recipts = recipts;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "incomeId", unique = true, nullable = false)
	public Integer getIncomeId() {
		return this.incomeId;
	}

	public void setIncomeId(Integer incomeId) {
		this.incomeId = incomeId;
	}

	@Column(name = "incomeName", nullable = false, length = 20)
	public String getIncomeName() {
		return this.incomeName;
	}

	public void setIncomeName(String incomeName) {
		this.incomeName = incomeName;
	}

	@Column(name = "incomeGrow", nullable = false, precision = 22, scale = 0)
	public Double getIncomeGrow() {
		return this.incomeGrow;
	}

	public void setIncomeGrow(Double incomeGrow) {
		this.incomeGrow = incomeGrow;
	}

	@Column(name = "incomeMinus", nullable = false, precision = 22, scale = 0)
	public Double getIncomeMinus() {
		return this.incomeMinus;
	}

	public void setIncomeMinus(Double incomeMinus) {
		this.incomeMinus = incomeMinus;
	}

	@Column(name = "incomeOrigin", nullable = false, precision = 22, scale = 0)
	public Double getIncomeOrigin() {
		return this.incomeOrigin;
	}

	public void setIncomeOrigin(Double incomeOrigin) {
		this.incomeOrigin = incomeOrigin;
	}

	@Column(name = "incomeFinal", nullable = false, precision = 22, scale = 0)
	public Double getIncomeFinal() {
		return this.incomeFinal;
	}

	public void setIncomeFinal(Double incomeFinal) {
		this.incomeFinal = incomeFinal;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "date", nullable = false, length = 10)
	public Date getDate() {
		return this.date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	@Column(name = "accountId", nullable = false)
	public Integer getAccountId() {
		return this.accountId;
	}

	public void setAccountId(Integer accountId) {
		this.accountId = accountId;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "income")
	public Set<Recipt> getRecipts() {
		return this.recipts;
	}

	public void setRecipts(Set<Recipt> recipts) {
		this.recipts = recipts;
	}

}